package com.lvan.fileupload.exceptionhandle;

import com.lvan.fileupload.bean.ResultMsg;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Lvan
 */

@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public ResultMsg error(Exception e) {
        e.printStackTrace();
        return ResultMsg.error().message("全局异常");
    }
}
